#! /usr/bin/python

from twofish import *

if __name__ == '__main__':
	plaintext = '\x00' * 16
	original_key = '\x00' * 16
	my_key = pre_expand_key(original_key, 16)
	if not my_key:
		exit(1)
	cipher = twofish_128_encrypt(plaintext, my_key)

	print 'Plaintext:'
	for char in plaintext:
		print "%.2x" % ord(char),
	print '\nCiphertext:'
	for char in cipher:
		print "%.2x" % ord(char),
	print
	
	plaintext = cipher
	cipher = twofish_128_encrypt(plaintext, my_key)
	print 'Plaintext:'
	for char in plaintext:
		print "%.2x" % ord(char),
	print '\nCiphertext:'
	for char in cipher:
		print "%.2x" % ord(char),
	print

